using System;
using System.Collections.Generic;
using System.Text;

namespace TidhiGanitam.DataModel
{
    public class ArkahaDetails
    {
        Rasi m_ArkahaTime;
        double m_CurrentNakshatramuIndex;
        double m_CurrentPadamuIndex;
        double m_CurrentRasiIndex;
        bool m_IsRasiArkaha;
        bool m_HasValues;

        public ArkahaDetails()
        {
            m_ArkahaTime = new Rasi();
            m_HasValues = false;
        }
        public ArkahaDetails(bool IsRasiArkaha, double ArkahaRasi, double Nakshatramu,
            double Padamu, Rasi ArkahaTime)
        {
            m_IsRasiArkaha = IsRasiArkaha;
            m_CurrentRasiIndex = ArkahaRasi;
            m_CurrentNakshatramuIndex = Nakshatramu;
            m_CurrentPadamuIndex = Padamu;
            m_ArkahaTime = new Rasi(ArkahaTime);
            m_HasValues = true;
        }
        public double CurrentRasiIndex
        {
            get
            { return m_CurrentRasiIndex; }
            set
            { m_CurrentRasiIndex = value; }
        }
        public double CurrentNakshatramuIndex
        {
            get
            { return m_CurrentNakshatramuIndex; }
            set
            { m_CurrentNakshatramuIndex = value; }

        }
        public double CurrentPadamuIndex
        {
            get
            { return m_CurrentPadamuIndex; }
            set
            { m_CurrentPadamuIndex = value; }

        }
        public string Nakshatramu
        {
            get
            { return Constants.Nakshatramu[Convert.ToInt32(m_CurrentNakshatramuIndex)]; }
        }
        public string Padamu
        {
            get
            { return Constants.Padamulu[Convert.ToInt32(m_CurrentPadamuIndex)]; }
        }
        public string ArkahaRasi
        {
            get
            { return Constants.Rasulu[Convert.ToInt32(m_CurrentRasiIndex)]; }
        }
        public Rasi ArkahaTime
        {
            get
            { return m_ArkahaTime; }
            set
            { m_ArkahaTime = value; }
        }
        public string GetArkahaDetailsString()
        {
            string retString = string.Empty;
            if (m_HasValues)
            {
                retString = string.Format("{0} {1}{2} {4} {3}",
                    (m_IsRasiArkaha) ? ArkahaRasi : string.Empty,
                    Nakshatramu,
                    Padamu,
                    m_ArkahaTime.DisplayFormat(Enums.DisplayFormat.LV),
                    "Arkaha");
            }
            return retString;
        }

    }
}
